#ifndef LOGR_USERS_H
#define LOGR_USERS_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>


#include "LOGR_paths.h"

typedef struct _web_user_node {
    char *uname;
    long naccesses;
    time_t startt;
    time_t endt;
    char *referer;
    char *epage;
    LNode_type *lepages;
    void *info;
    WebPathPtr cpath;
    LNode_type *ltimes;
} WebUserStruct;

typedef struct _web_user_node *WebUserPtr;

WebUserPtr
new_web_user_node(void);

void
delete_web_user_node(WebUserPtr opn);

void
LOGR_set_user_naccesses(WebUserPtr usn,long num);

void
LOGR_inc_user_naccesses(WebUserPtr usn);

long
LOGR_get_user_naccesses(WebUserPtr usn);

void
LOGR_set_user_name(WebUserPtr usn,char *name);

char *
LOGR_get_user_name(WebUserPtr usn);

void
LOGR_set_user_start_time(WebUserPtr usn,time_t stime);

time_t
LOGR_get_user_start_time(WebUserPtr usn);

void
LOGR_set_user_end_time(WebUserPtr usn,time_t etime);

time_t
LOGR_get_user_end_time(WebUserPtr usn);

void
LOGR_set_user_info(WebUserPtr usn,void * info);

void *
LOGR_get_user_info(WebUserPtr usn);

void
LOGR_set_user_referer(WebUserPtr usn,char *referer);

void
LOGR_delete_user_referer(WebUserPtr usn);

char *
LOGR_get_user_referer(WebUserPtr usn);

void
LOGR_set_user_entry_page(WebUserPtr usn,char *entry_page);

void
LOGR_delete_user_entry_page(WebUserPtr usn);

char *
LOGR_get_user_entry_page(WebUserPtr usn);

const char *
LOGR_get_user_entry_page_title(WebUserPtr usn,GraphFrame *gf);

void
LOGR_set_user_ltimes(WebUserPtr upn,LNode_type * ltimes);

void
LOGR_add_user_time(WebUserPtr upn,void *time);

LNode_type *
LOGR_get_user_ltimes(WebUserPtr upn);

WebPathPtr
LOGR_get_user_current_path(WebUserPtr usn);

void
LOGR_set_user_current_path(WebUserPtr usn,WebPathPtr cpath);

WebUserPtr 
LOGR_new_web_user_info(char *dns, char *urls, char *urlt);

void
LOGR_set_user_lepages(WebUserPtr usn,LNode_type * lepages);

void
LOGR_add_user_entry_page(WebUserPtr usn,void *gen_page);


LNode_type *
LOGR_get_user_lepages(WebUserPtr usn);

#endif

